Improving Error-Handling Code in Systems Software

نویسنده

  • Suman Saha
چکیده

Reliability is essential in systems software. A key element of ensuring reliability is proper handling of error conditions [26]. In general, the role of error handling code is to return the system to a coherent state, typically by undoing recent operations and releasing recently allocated resources. If some of these resource-releasing operations are omitted, the result can be deadlocks and memory leaks. If resource-releasing operations are performed in the wrong order, the result can be invalid data accesses, such as null-pointer dereferences and double frees. These issues are especially critical in the case of operating systems, such as Linux, as an operating system manages many resources over a long period of time, increasing the amount of error conditions that can occur and resource-releasing operations that are needed, and heightening the accumulated impact of any memory leaks. The C language does not provide any abstractions for exception handling or other forms of error handling, leaving programmers to devise their own conventions for detecting and handling errors. The Linux coding style guidelines suggest placing error handling code at the end of each function, where it can be reached by gotos whenever an error is detected. This coding style has the advantage of putting all of the error-handling code in one place, which eases understanding and maintenance, and reduces code duplication. Nevertheless, this coding style is not always applied. Even when error handling code is structured according to the Linux coding style guidelines, the management of the releasing of allocated resources remains a continual problem in ensuring the robustness of systems code [21]. Missing resource-releasing operations lead to faults in source code. A number of approaches have been proposed to detect such problems [6, 12, 14, 25], but they often have a high rate of false positives, or focus only on commonly used functions. I observe that resource-releasing operations are often found in error-handling code, and that the choice of resource-releasing operation may depend on the context in which it is to be used. The overall goal of my PhD work is to improve error handling in system’s code. I have divided my PhD work into three parts. The first part focuses on improving the structure of error handling code with the goal of helping to reduce the number of system faults that may occur in error handling code in future. The second part focuses on finding existing system faults in the error handling code. The third part focuses on fixing the detected system faults in the error handling code. In the first half of my PhD, I have completed the first part of the PhD work by proposing an approach to improve the structure of error handling code. I have also partially completed the second part of the PhD work by proposing an approach to detect existing resource release omission faults in the error handling code. In the second half of my PhD, I will extend the fault detection approach to detect concurrency and semantic system faults also. Concurrency faults are those that happen only in a multi-threading environment. They are cause by ill-synchronized operations from multiple threads. Semantic faults are faults that are inconsistent with the original design and the programmers’ intention. Finally, in order to complete the third part of my Phd work, I will investigate how to automatically fix all detected system faults in the error handling code. The rest of this report is organized as follows. Section 2 presents an algorithm to improve the structure if error handling code. This work was published in LCTES’11, in the paper An Approach to Improving

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Finding Error-Handling Bugs in Systems Code Using Static Analysis

Run-time errors are unavoidable whenever software interacts with the physical world. Unchecked errors are especially pernicious in operating system file management code. Transient or permanent hardware failures are inevitable, and errormanagement bugs at the file system layer can cause silent, unrecoverable data corruption. Furthermore, even when developers have the best of intentions, inaccura...

متن کامل

The Exception Handling Effectiveness of POSIX Operating Systems

ÐOperating systems form a foundation for robust application software, making it important to understand how effective they are at handling exceptional conditions. The Ballista testing system was used to characterize the handling of exceptional input parameter values for up to 233 POSIX functions and system calls on each of 15 widely used operating system (OS) implementations. This identified wa...

متن کامل

EHCtor: Detecting Resource-Release Omission Faults in Error-Handling Code for Systems Software

Adequate error-handling code is essential to the reliability of any system. On an error, such code is responsible for releasing acquired resources to restore the system to a viable state. Missing resource-release operations can lead to system crashes, memory leaks and deadlocks. A number of approaches have been proposed to detect such problems, but they mainly target frequently occurring resour...

متن کامل

Mining API Error-Handling Specifications from Source Code

API error-handling specifications are often not documented, necessitating automated specification mining. Automated mining of error-handling specifications is challenging for procedural languages such as C, which lack explicit exception-handling mechanisms. Due to the lack of explicit exception handling, error-handling code is often scattered across different procedures and files making it diff...

متن کامل

Static Detection of API Error-Handling Bugs via Mining Source Code

Incorrect handling of errors incurred after API invocations (in short, API errors) can lead to security and robustness problems, two primary threats to software reliability. Correct handling of API errors can be specified as formal specifications, verifiable by static checkers, to ensure dependable computing. But API error specifications are often unavailable or imprecise, and cannot be inferre...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2011